/**
 * 
 */
package ptvv;

/**
 * @author dkz
 * 
 */
public class States2 extends DefaultAutomata {
	// Private Variables
	String message;

	public States2() {
		this.setName("Second");

	}

	public void starting() {
		try {
			System.out.println("Second 2 wait");
			String item;

			// Thread.currentThread().interrupt();
			item = eventQueue.take();
			// System.out.println(item);
			System.out.println("Out of wait");
		} catch (InterruptedException iex) {
			System.out.println("Interrupted");

		}

	}

	public void ready() throws InterruptedException {
		// message = inputPort.remove();
	}

	public void running() {
		// message += " second done";
		// logger.log(message);
	}

	public void suspended() {

	}

	public void end() {
		logger.log("output: " + this.getName() + ": " + message);

		logger.log("SHUTDOWN");

		// outputPort.destination.addInput(message);
		// outputPort.destination.addEvent("start");
	}

	public void dead() {
		// this.internalState = InternalStates.ReallyDead;

	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		// States2 first = new States2();

		// Tester tester = new Tester(first);

		// (new Thread(tester)).start();
		// (new Thread(first)).start();

	}

}
